cmake_minimum_required(VERSION 3.22)
project(WULC_PQC C)

set(CMAKE_C_STANDARD 11)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif()

set(CMAKE_C_FLAGS "-Wall -Wextra")
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_RELEASE "-O3")

include_directories(inc)

aux_source_directory(src COMMON_DIR)
aux_source_directory(src/hash HASH_DIR)
aux_source_directory(src/rand RAND_DIR)
aux_source_directory(src/dilithium DILITHIUM_DIR)
aux_source_directory(src/test TEST_DIR)

add_library(COMMON_FUNCTION ${COMMON_DIR})
add_library(DILITHIUM_FUNCTION ${DILITHIUM_DIR})
add_library(HASH_FUNCTION ${HASH_DIR})
add_library(RAND_FUNCTION ${RAND_DIR})

#add_executable(${PROJECT_NAME} ${TEST_DIR} ${COMMON_DIR} ${DILITHIUM_DIR} ${HASH_DIR})
add_executable(${PROJECT_NAME} ${TEST_DIR})

target_link_libraries(DILITHIUM_FUNCTION  HASH_FUNCTION RAND_FUNCTION)

target_link_libraries(${PROJECT_NAME} DILITHIUM_FUNCTION COMMON_FUNCTION RAND_FUNCTION)